package com.mowh.gof23.structural.patterns.flyweight;

/**
 * @author mowh1gd
 * @create 2023/10/27 9:34
 */
public class BigString {
    private BigChar[] bigChars;

    public BigString(String aString) {
        bigChars = new BigChar[aString.length()];
        BigCharFactory factory = BigCharFactory.getInstance();
        for (int i = 0; i < bigChars.length; i++) {
            bigChars[i] = factory.getBigChar(aString.charAt(i));
        }
    }
    public void print() {
        for (int i = 0; i < bigChars.length; i++) {
            bigChars[i].print();
        }
    }
}
